package de.toolschmied.jjas.client.cms.actions;

import de.toolschmied.jjas.client.widgets.toolbar.Action;

public class AlignmentAction extends Action {

	public interface AlignmentListener {
		
		void alignmentChanged(Alignment alignment);
		
	}
	
	private final Alignment alignment; 
	private final AlignmentListener listener;
	
 	AlignmentAction(Alignment alignment, AlignmentListener listener) {
		super(alignment.getName(), alignment.getTooltip(), alignment.getButtonImageURL(), Type.RADIO);
		this.alignment = alignment;
		this.listener = listener;
	}

	@Override
	public void run() {
		listener.alignmentChanged(alignment);
	}

	public Alignment getAlignment() {
		return alignment;
	}

}
